package cn.xuewei.mapper;


import cn.xuewei.pojo.entity.User;
import cn.xuewei.pojo.vo.UserAdminVO;
import cn.xuewei.pojo.vo.UserChatVO;
import cn.xuewei.pojo.vo.UserVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {
    /**
     * 新建用户
     * @param user
     * @return
     */
    int insert(User user);

    /**
     * 查询用户名
     * @param username
     * @return
     */
    UserVO selectByUsername(String username);


    void update(User user);

    List<UserAdminVO> select();

    void deleteById(Long userid);

    UserChatVO selectByPrimaryKey(Integer id);

    List<UserChatVO> getCloudList(@Param("list") List<Integer> list);

    UserChatVO selectChatVOByUsername(String username);

    UserChatVO selectChatVoByPrimaryKey(Integer id);

    //获取用户余额
    double getBalance(Long user_id);
    //修改用户余额
    void updateBalance(Long user_id,double balance);

    void adminBalance(Long user_id, double balance);

    String selectNickNameById(Integer user_id);

    String selectImgById(Integer id);
}
